package com.faxsun.web.endpoint.entity;

import mblog.web.formatter.JsonUtils;

import com.faxsun.core.persist.entity.UserPO;
import com.faxsun.core.pojos.enums.AccountType;

/**
 * 用户信息Json实体
 * 
 * @author songdragon 2015年6月18日
 *
 */
public class UserJSON {
	public String name;
	public String avatar;
	public AccountType type;
	public long id;

	public static String toString(UserJSON o) {
		return JsonUtils.toJson(o);
	}

	public static UserJSON parse(UserPO user) {
		UserJSON userJson = new UserJSON();
		userJson.id = user.getId();
		userJson.name = user.getName();
		userJson.avatar = user.getAvatar();
		return userJson;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getAvatar() {
		return avatar;
	}

	public void setAvatar(String avatar) {
		this.avatar = avatar;
	}

	public AccountType getType() {
		return type;
	}

	public void setType(AccountType type) {
		this.type = type;
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

}